import { getVideoList } from '../../../model/service/video/getVedioService';

export default async function getVideo(ctx: Context, next: Next) {
  const { body } = ctx.request;
  const { keyword, pageSize, pageNum } = body;

  try {
    const result = await getVideoList({keyword: keyword || '', pageSize, pageNum});
    ctx.api.success(result, 'success');
  } catch (error) {
    ctx.api.fail(-1, '查询失败')
  }


  return next();
}